/*
 * Created Jan 9, 2008. 
 */
package com.wgo.precise.server.wiring;

import java.util.Set;

import org.junit.Assert;

import com.wgo.bpot.domain.common.User;

/**
 * @author Petter L. H. Eide
 * @version $Id: PreciseUsersFileServicesTestBase.java 540 2008-01-09 19:42:31Z petter.eide $
 */
public class PreciseUsersFileServicesTestBase {
	
	protected int verifyUsers(Set<User> users) {
		int validUsers = 0;
		for ( User user : users) {
			if (verify(user)) {
				validUsers++;
			}
		}
		return validUsers;
	}

	protected boolean verify(User user) {
		Assert.assertNotNull("FirstName should not be null.", user.getFirstName());
		Assert.assertNotNull("LastName should not be null.", user.getLastName());
		Assert.assertNotNull("UserName should not be null.", user.getUserName());
		Assert.assertNotNull("Password should not be null.", user.getPassword());
// FIXME: user role is not persisted:
//		Assert.assertNotNull("UserRole should not be null for user: " + user.getUserName() + ".", user.getUserRole());
//		Assert.assertNotNull("Description should not be null.", user.getDescription()); TODO
		return true;
	}

}
